ModuleRef is a reference to the current module's DI container. Inject it to resolve providers imperatively at runtime — useful when you need a provider conditionally or need to retrieve a transient/request-scoped provider dynamically. Use moduleRef.get() for singletons and moduleRef.resolve() for scoped providers.
Strategy pattern — dynamically choose which provider to use at runtime.
Lazy initialization — resolve a heavy provider only when first needed.
Factory services — create instances of transient providers on demand.
moduleRef.get() is synchronous and only works for singleton providers.
moduleRef.resolve() is async and creates a new DI sub-context for scoped providers.